package com.ruoyi.web.controller.vidiomonitor;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.hikvisionutils.HikVisionUtils;
import com.ruoyi.common.utils.hikvisionutils.model.HIKResponseResult;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/videoapi/project")
public class ProjectVideo extends BaseController {
    @RequestMapping(value = "/resources", method = RequestMethod.POST)
    public AjaxResult getCamerasIndexCode(@RequestBody Map<String, Object> params) {
        String body = HikVisionUtils.getSingleDevice(params).getBody();
        HIKResponseResult hikResponseResult = JSONObject.parseObject(body, HIKResponseResult.class);
        return AjaxResult.success(hikResponseResult.getData());
    }
}
